package cate.game.pvp.gradepvp.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBGradePvp;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "匹配 の 请求")
public class GradePvpMatchReq implements MsgInput {
    @NoteField(value = "是否跳过布阵 1是 2否")
    public int skip;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        cc.getRole().getPvp().gradePvp.checkOpen();
        if (!cc.getRole().getPvp().gradePvp.isOpen()) {
            game.notice.message(cc.getRole(),"功能未开启");
            return;
        }
        GameResult<Void> r = cc.getRole().getPvp().gradePvp.match(skip);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBGradePvp.MATCH_REQ;
    }
}
